<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileOverview 뉴스스탠드 홈의 최상위 컨트롤러
<span class='line'>  3</span>  * @author oz_moon
<span class='line'>  4</span>  */</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="NAME">nhn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.nhn</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="NAME">nhn.newsstand.home</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="NAME">nhn.newsstand.home.Controller</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Class</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">	</span><span class="COMM">/** @lends nhn.newsstand.home.Controller.prototype */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 12</span> 	 * nhn.newsstand.home.Controller 클래스의 인스턴스를 생성한다.
<span class='line'> 13</span> 	 * @constructs
<span class='line'> 14</span> 	 * @class 홈의 최상위 컨트롤러
<span class='line'> 15</span> 	 * @extends nhn.newsstand.common.AbstractController
<span class='line'> 16</span> 	 * @requires nhn.newsstand.home.DateToolController
<span class='line'> 17</span> 	 * @requires nhn.newsstand.home.SectionListController
<span class='line'> 18</span> 	 * @requires nhn.newsstand.home.ListBySectionController
<span class='line'> 19</span> 	 * @requires nhn.newsstand.home.HotNewsListController
<span class='line'> 20</span> 	 * @requires nhn.newsstand.home.ListByHotNewsController
<span class='line'> 21</span> 	 * @requires nhn.newsstand.common.util
<span class='line'> 22</span> 	 * @example
<span class='line'> 23</span> 	 * var oController = new nhn.newsstand.home.Controller({ sTodayDate : "20111103", sLoginYn : "Y" });
<span class='line'> 24</span> 	 * 1. sTodayDate => 서버에서 넘겨주는 초기 셋팅용 날짜(default:오늘날짜)
<span class='line'> 25</span> 	 * 2. sLoginYn => 로그인 여부(Y:로그인, N:로그아웃, default:"N")
<span class='line'> 26</span> 	 * 
<span class='line'> 27</span> 	 * !! 인스턴스 생성 후 별도의 실행 메서드(startUp)를 실행시켜야 스크립트가 동작한다.
<span class='line'> 28</span> 	 * ex) oController.startUp();
<span class='line'> 29</span> 	 */</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">	</span><span class="NAME">$init</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oOption</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oDefaultOption</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">			</span><span class="NAME">sTodayDate</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dDate.getFullYear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">oUtil.addZero</span><span class="PUNC">(</span><span class="NAME">dDate.getMonth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">oUtil.addZero</span><span class="PUNC">(</span><span class="NAME">dDate.getDate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">			</span><span class="NAME">sLoginYn</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"N"</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">		</span><span class="NAME">this.options</span><span class="PUNC">(</span><span class="NAME">oDefaultOption</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">		</span><span class="NAME">this.options</span><span class="PUNC">(</span><span class="NAME">oOption</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">		</span><span class="COMM">//오늘의 신문 영역</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elDateToolbar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"._dateToolbar"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elListByDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"._paperListByDate"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"dateTool"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.DateToolController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elDateToolbar</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"listByDate"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.ListByDateController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elListByDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">		</span><span class="COMM">//주제별 뉴스 영역</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elListBySectionArea</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"._sectionList"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"sectionList"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.SectionListController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elListBySectionArea</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"ListBySection"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.ListBySectionController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elListBySectionArea</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">		</span><span class="COMM">//핫 뉴스 영역</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elListByHotNews</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">"._hotNewsList"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"hotNewsList"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.HotNewsListController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elListByHotNews</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">		</span><span class="NAME">this.addController</span><span class="PUNC">(</span><span class="STRN">"ListByHotNews"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.home.ListByHotNewsController</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">elListByHotNews</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 55</span> 
<span class='line'> 56</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">extend</span><span class="PUNC">(</span><span class="NAME">nhn.newsstand.common.AbstractController</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span></pre></body></html>